import { createStore } from 'vuex'

const store =  createStore({
    state(){
        return{
            count:10
        }
    },
    getters:{
        tenTimes:(state) =>{
        return state.count *10
       }
    },
    mutations:{
        incrementMut(state,playload){
            state.count = playload.count
        }
    },
    actions:{
        incrementAct(context,playload){
            setTimeout(()=>{
                context.commit('incrementMut',playload)
            },3000)
        }
    }
    
})

export default store